package com.xuecheng.content.api;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Date:2023/8/16
 * Author:丐版小杨哥
 * Description: freemarker 入门程序
 */
@Controller
public class FreemarkerController {
    @RequestMapping("/FreemarkerTest")
    public ModelAndView test(){
        ModelAndView modelAndView = new ModelAndView();
        //指定模型
        modelAndView.addObject("name","小明");
        //指定模板
        modelAndView.setViewName("test");
        return modelAndView;
    }
}